import React,{ Component } from 'react'
import { Text,View,StyleSheet,WebView,TouchableOpacity } from "react-native";

export default class index extends Component{
    constructor(props){
        super(props);
        this.state = {
            data:{
                title:"关于九月份支部活动会后任务交流",
                content:"兹定于2018年11月22日上午9点30分，在鄂尔多斯市老干部局(党政大楼六楼601)，召开联络员工作会议，布置重要工作，敬请准时出席 </br><p>特此通知！</p>"
            },
        }
    }

    render(){
        const { navigation }  = this.props;
        return (
            <View style={ styles.container }>
                <Text style={ styles.title }>{ this.state.data.title ?(this.state.data.title).length>15?(this.state.data.title).substr(0,15)+"...":this.state.data.title:""}</Text>
                <Text style={ styles.dataTime }>2018-11-20</Text>
                <WebView
                    originWhitelist={ ['*'] }
                    source={ { html: this.state.data.content} }
                />
                <View style={ styles.BottomDobul }>
                    <TouchableOpacity onPress={()=>{
                        alert('参加')
                    }}>
                        <Text style={  styles.TopDobul}>报名参加</Text>
                    </TouchableOpacity>
                   <TouchableOpacity onPress={()=>{
                        alert('不参加')
                   }}>
                       <Text style={ styles.TwoDobul }>不参加</Text>
                   </TouchableOpacity>
                </View>
        </View>)
    }
}

const styles = StyleSheet.create({
    container:{
        flex:1,
        paddingLeft: 15,
        paddingTop: 25,
        paddingRight: 15,
        paddingBottom: 25,
        backgroundColor:'white'
    },
    title:{
        fontSize:20,
        fontWeight: '200',
        textAlign: 'center',
    },
    dataTime:{
        textAlign: 'right',
        marginTop: 10,
        color:'#999999',
    },
    BottomDobul:{
        marginTop: 10,
        marginBottom: 20,
        flexDirection: 'row',
        justifyContent: 'space-around',
    },
    TopDobul:{
        width:140,
        height:40,
        backgroundColor: '#d04542',
        textAlign:'center',
        lineHeight:40,
        borderRadius:4,
        color:'white',
    },
    TwoDobul:{
        width:140,
        height:40,
        textAlign:'center',
        lineHeight:40,
        borderRadius:4,
        borderColor:'#d04542',
        borderWidth:1,
        color:'#d04542',
    }
});